<?php html::pushHead('user/reg.css', TRUE);?>
<form method="post" id="p_userReg" action="" class="post-tr box h-box" onsubmit="{sg();return false;}">
  <span class="sh">帐号：</span>
  <span class="sp"><input type="text" name="regName" check="^\S{4,}$" title="必须大于4个字符" />*<i class="err-note"></i></span>
  
  <span class="sh">密码：</span>
  <span class="sp"><input type="password" id="l_password" name="password" check="^\S{3,}$" title="必须大于3个字符" />*<i class="err-note"></i></span>
  <span class="sh">确认密码：</span>
  <span class="sp"><input type="password" id="l_password2" check="^\S+$" value="" />*<i id="er_password2" class="err-note"></i></span>
  
  <div class="separator"></div>
  <span class="sh">称呼：</span>
  <span class="sp"><input type="text" name="d[compellation]" /></span>
  <span class="sh">性别：</span>
  <span class="sp"><?php html::radioName(' name="d[sex]"', lang::Ag(array('boy','gril')))?></span>
  
  <div class="separator"></div>
  <span class="sh">推荐人帐号：</span>
  <span class="sp"><input type="text" name="parent_id" value="" /></span>
  <span class="sh"></span>
  <span class="sp"><input type="submit" value="注 册" class="submit" /> &nbsp; &nbsp; &nbsp; <a href="<?php echo url::g('u=cuser\login');?>">已注册</a></span>
</form>

<script>
function sg(){
    var f= $('#p_userReg');
    if (!CheckForm(f[0]))return;
    if ($('#l_password').val()!=$('#l_password2').val() ){
        $('#er_password2').text('密码不一致').show().delay(1200).fadeOut(400);
        return;
     }
     
    $.post(ROOT_URL+'?u=cuser\\reg-fs', f.serialize(), function(r){
        if(checAjaxRe(r)){
            box('注册成功，<a href="'+ROOT_URL +'?u=cuser\\login&ju=./">去登录</a>');
        }
    });
}
</script>